package com.chen.cloud.micro.consumer.movie.controller;


import com.chen.cloud.micro.consumer.movie.api.UserFeignClient;
import com.chen.cloud.micro.consumer.movie.dto.User;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author ChenTian
 * @date 2022/6/1
 */
@RestController
@RequestMapping("/movie/v1")
public class MovieController {

    @Resource
    private UserFeignClient userFeignClient;

    @GetMapping("/{id}")
    public User findById(@PathVariable Long id){
        User entity = userFeignClient.findById(id);
        return entity;
    }

    @PostMapping("/create")
    public User create(@RequestBody User user){
        User entity = userFeignClient.create(user);
        return entity;
    }

}
